package yjl.spec.edu.week10_class2.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import yjl.spec.edu.week10_class2.R;

public class FistActivity extends AppCompatActivity {

    @Override
    protected void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.first_activity);
        Button button1=(Button) findViewById(R.id.button_1);
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(FistActivity.this,"Hello FistActivity",
                        Toast.LENGTH_SHORT).show();
                Intent intent = new Intent(FistActivity.this,SecondActivity.class);
                startActivity(intent);
            }
        });
    }
}
